<%-- 
    Document   : modifProduct
    Created on : 7 avr. 2013, 13:09:36
    Author     : KJWT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.List"%>
<%@page import="entities.Account"%> 
<%@page import="java.util.ArrayList"%> 

<title>Adopte Un Presta - Modification d'un prestataire</title>
<meta charset="utf-8">
<meta name="description" content="Site de vente de prestataires">
<meta name="keywords" content="Prestataire, SSII, recrutement, RH, vente">
<meta name="author" content="Kheira, Jef, William, Tuan">
<link rel="stylesheet" href="css/style.css">
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/script.js"></script>

<script type="text/javascript" language="javascript">
    function supprimer() {
        if (confirm("Vous désirez vraiment supprimer ce Presta ?")) {
            alert ("Vous venez de supprimer un presta !");
        }
             
        else {
            alert("Vous avez cliqué sur ANNULER ou vous avez fermé");
            header('Location: portfolio.jsp'); 
        }
    }
            
    function confirme(idProduct, nomProduct)
    {
        var confirmation = confirm( "Voulez vous vraiment supprimer le prestataire : \n"+nomProduct+" ?" ) ;
        if(confirmation)
        {
            document.location.href = "ServletChargementDonnees?action=supprimerPresta&idPrestaSup=" +idProduct;
        }
    }
</script>
<body>
    <!-- PRO Framework Panel Begin -->
    <div id="advanced">
        <span class="trigger">
            <strong></strong>
            <em></em>
        </span>
        <div class="bg_pro">
            <div class="pro_main">
                <a href="" class="pro_logo"></a>
                <ul class="pro_menu">
                    <li>
                        <a href="index.jsp">
                            <img src="images/pro_home.png" alt="">
                        </a>
                    </li>

                    <c:if test="${isLoggedIn == 'true'}">
                        <li style="margin-left: 300px">
                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=displayCart">Mon Panier</a>
                        </li>
                        <li>
                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=afficherMonCompte">Mon Compte</a>
                        </li>
                        <li>
                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=logout">Déconnexion</a>
                        </li>
                    </c:if>
                    <c:if test="${isLoggedIn != 'true'}">
                        <li style="margin-left: 300px">
                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=displayCart">Mon Panier</a>
                        </li>
                        <li>
                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=gotoSubscribe">Inscription</a>
                        </li>
                        <li><a>Se connecter<span></span></a>  
                            <ul>
                                <form action="/AdopteUnPrestaWA/ServletChargementDonnees?action=login" method="POST">
                                    <div>
                                        <label for="login">Identifiant : </label> <br/>
                                        <input name="login" type="text" size="10" maxlength="255" style="height:15px;font-size:14px;width: 130px"/> <br/><br/>                          
                                    </div>
                                    <div>
                                        <label for="password"> Mot de passe : </label> <br/>
                                        <input name="password" type="password" size="10" maxlength="255" style="height:15px;font-size:14px;width: 130px"/> <br/><br/>
                                    </div>
                                    <input class="btn sign-in" type="submit" value="Connexion" />
                                </form>
                            </ul>
                        </li>
                    </c:if>
                </ul>          
            </div>       
        </div>   
    </div>

    <!-- PRO Framework Panel End -->
    <div class="bg-main">
        <!--==============================header=================================-->

        <header>
            <div class="container_24">
                    <div class="wrapper">
                        <div class="grid_13">
                            <h1><a href="index.jsp">Idealex</a></h1>
                        </div>
                        <div class="grid_11">
                            <form action="/AdopteUnPrestaWA/ServletChargementDonnees?action=rechercher" method="POST">
                                <div align="right">
                                    <input style=" font:11px/15px Arial, Helvetica, sans-serif; " type="text" name="search_query">
                                    <input style=" background:#1f2025; font:11px/15px Arial, Helvetica, sans-serif; text-transform:uppercase; color:#eaeaea; padding:8px 8px 8px 8px;" type="submit" value="Rechercher">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
           
            <nav class="main-menu">
                <ul class="sf-menu">
                    <li><a href="more.jsp"><em>A propos</em><strong></strong></a><ul>
                            <li><a href="more.jsp">Qui sommes-nous ?</a></li>
                            <li><a href="enConstruction.jsp">Nouvelles</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=product">Produits</a></li>
                        </ul>
                    </li>
                    <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=product"><em>Produits</em><strong></strong></a><ul>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=product">Tous</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=developer">Développeurs</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=projectManager">Chefs de projet</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=productManager">Responsables produits</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=architect">Architectes</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=coach">Coach / Scrum Master</a></li>
                            <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=consultant">Consultants</a></li>
                        </ul>
                    </li>	
                    <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=productStores"><em>Partenaires</em><strong></strong></a></li>
                    <li><a href="enConstruction.jsp"><em>Autres</em><strong></strong></a></li>
                    <li><a href="enConstruction.jsp"><em>Clients</em><strong></strong></a></li>
                    <c:set var="etatUtilisateur" scope="session" property="account.accessLevel" />

                    <c:if test="${account.accessLevel == 2}">
                        <!-- c:out value="Bienvenue super-admin" /> -->
                        <li><a href="super-admin.jsp"><em>Administration</em><strong></strong></a><ul>
                                <li>Compte</li>
                                <li><a href="ajoutAccount.jsp">Créer Compte</a></li>
                                <li><a href="modifAccount.jsp">Modifier/Supprimer</a></li>
                                <li>ProductStore</li>
                                <li><a href="ajoutProductStore.jsp">Créer ProductStore</a></li>
                                <li><a href="modifProductStore.jsp">Modifier/Supprimer</a></li>
                                <li>Prestataires</li>
                                <li><a href="ajoutPresta.jsp">Créer Presta</a></li>
                                <li><a href="modifPresta.jsp">Modifier/Supprimer</a></li>     
                                <li>Autres</li>	
                            </ul>
                        </li>
                    </c:if>
                    <c:if test="${account.accessLevel == 1}">
                        <!-- c:out value="Bienvenue admin" /> -->                                        
                        <li><a href="admin.jsp"><em>Options</em><strong></strong></a><ul>
                                <li><a href="ajoutPresta.jsp">Créer Presta</a></li>
                                <li>Autres</li>						
                            </ul>				
                        </li>	


                    </c:if>
                    <c:if test="${account.accessLevel == 0}">
                        <!-- c:out value="Bienvenue utilisateur" /> -->
                        <li></li>
                    </c:if>
                    <li class="last"><a href="contacts.jsp"><em>Contacts</em><strong></strong></a></li>
                </ul>
                <div class="clear"></div>
            </nav>

        </header>

        <h1 align="center"><font color="black"> Menu de modification et de suppression d'un prestataire </font></h1>  
        <center>
            <section>                
                <caption>Liste des prestataires</caption>
               <table id="formulaire" border="1" width="400px" height="300px"> 
                    <tr><th>Nom</th><th>Prenom</th><th>Prix</th><th>Etat</th><th>Categorie</th><th>Modifier</th><th>Supprimer</th></tr>

                    <c:forEach var="item"  items="${sessionScope['mesPrestataires']}" >          
                        <tr align="center">   
                            <td> <c:out value="${item.nom}"/></td>       
                            <td> <c:out value="${item.prenom}"/></td>   
                            <td> <c:out value="${item.prix}"/></td>
                            <td> <c:out value="${item.etat}"/></td>
                            <td> <c:out value="${item.categorieidCategorie}"/></td>
                            <td><a href="ServletChargementDonnees?action=modifierPresta&idPrestaModif=${item.idProduct}"> <!-- <input type='text' readonly="true" name='idAccount' width="20" value="$ {item.idAccount}" />--> <!-- c:set var="accountModif" scope="session" value="$ {item}"/> --> <img src='images/modifier.jpg' height="25" width="25" title='modifier'></a>
                                <!--< c:set scope="session" var="idAccountModif2" value="$ {item.idAccount}" /> -->
                            <td><a href="/AdopteUnPrestaWA/modifPresta.jsp\#" onClick='confirme("${item.idProduct}","${item.nom}")'> <img src='images/supprimer.jpg' height="25" width="25" title='supprimer'></a>
                        </tr>        
                    </c:forEach>


                </table> 



            </section> 

        </center>  
</div>

        <!--==============================footer=================================-->
        <footer>
            <div class=" container_24">
                <div class="wrapper">
                    <div class="grid_6 suffix_2">
                        <h1 class="footer-logo"><a href="index.jsp">idealex</a></h1>
                        <p>Adopte Un Presta</p>
                        <p class="color1 privacy">&copy; 2013 <span>|</span>  <a href="index-7.html">Politique de confidentialité</a> <!-- {%FOOTER_LINK} --></p>
                    </div>
                    <div class="grid_7 suffix_2">
                        <h4>Liens connexes</h4>
                        <div class="wrapper">
                            <div class="grid_4 alpha">
                                <ul class="footer-list">
                                    <li><a href="more.jsp">A propos de nous</a></li>
                                    <li><a href="more.jsp">Notre concept</a></li>
                                    <li><a href="more.jsp">Nos partenaires</a></li>
                                    <li><a href="more.jsp">Evénements &amp; Press</a></li>
                                    <li><a href="more.jsp">Nous contacter</a></li>
                                </ul>
                            </div>
                            <div class="grid_3 omega">
                                <ul class="footer-list">
                                    <li><a href="more.jsp">Se connecter</a></li>
                                    <li><a href="more.jsp">Forums</a></li>
                                    <li><a href="more.jsp">Programme de fidélité</a></li>
                                    <li><a href="more.jsp">FAQ</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="grid_7">
                        <h4>Nous suivre</h4>
                        <ul class="tooltips">
                            <li><a href="more.jsp"><img src="images/icon1.png" alt=""><span>RSS</span></a></li>
                            <li><a href="more.jsp"><img src="images/icon3.png" alt=""><span>Facebook</span></a></li>
                            <li><a href="more.jsp"><img src="images/icon2.png" alt=""><span>Twitter</span></a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </footer>
</body>
</html>